package com.pushdemo.logic;

import org.apache.cordova.CordovaWebView;
import android.app.Activity;
import android.util.Log;

import com.foss.push.socket.PushSetup;

/**
 * Created by zhouzhineng on 14-8-22.
 * js调用本地的委托
 */
public class JsCallNativeDelegate {

    public final static String TAG = "JsCallNativeDelegate";
    private CordovaWebView webView;
    private Activity activity;

    public JsCallNativeDelegate(CordovaWebView webView,Activity activity) {
        this.webView = webView;
        this.activity = activity;
    }

    /**
     * 开启推送服务
     */
    public void startPushInvoke() {
        Log.d(TAG,"startPushInvoke called.......");
        //PushSetup.isReadyToConn = false;
       // ChameleonLogicDelegate.getInstance().initExecJscapacity(webView);
        //ChameleonLogicDelegate.getInstance().begin(activity);
    }

    /**
     * 关闭推送
     */
    public void stopPushInvoke() {
        Log.d(TAG,"stopPushInvoke called.......");
        //PushSetup.isReadyToConn = false;
       /* webView.sendJavascript("var pushNotification = window.plugins.pushNotification;\n" +
                "var json = '{ \"xx\": \"yy\", \"zz\": jj }';\n" +
                "pushNotification.unregister(function(){},function(){},json);");*/
    }
}
